home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / INCLUDES / I3DSHTRE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  19.3 KB  |  385 lines

  1. /* $Id: I3DShTre.H 1.56 1997/06/23 00:13:13 john Exp $ */
  2. /*****************************************************************************\
  3. *                                                                             *
  4. * I3DShTre.h                                                                                *
  5. *   I3DShTreeElement definition                                               *
  6. *                                                                             *
  7. *           Copyright (c) 1995, Ray Dream, Inc. All rights reserved.          *
  8. *                                                                             *
  9. \*****************************************************************************/
  10.  
  11. #ifndef __I3DSHTRE__
  12. #define __I3DSHTRE__
  13.  
  14. #ifndef __3DCOTYPE__
  15. #include "3DCoType.h"
  16. #endif
  17.  
  18. #ifndef __I3DSHOBJ__
  19. #include "I3DShObj.h"
  20. #endif
  21.  
  22. #ifndef __I3DEXLIT__
  23. #include "I3DExLit.h"
  24. #endif
  25.  
  26. struct I3DShScene;
  27. struct IShRasterOffscreen;
  28.  
  29. struct I3DExReflectionFeature;
  30. struct I3DExRefractionFeature;
  31. struct I3DExShadowFeature;
  32. struct I3DExGenericData;
  33.  
  34. //****** Globally Unique Ids **************************************************
  35.  
  36. DEFINE_GUID(IID_I3DShTreeElement, 0xD68FEB00L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  37. DEFINE_GUID(IID_I3DShGroup, 0xD8B0A820L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  38. DEFINE_GUID(IID_I3DShInstance, 0xDAF2F700L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  39. DEFINE_GUID(IID_I3DShCamera, 0xE76CA120L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  40. DEFINE_GUID(IID_I3DShLightsource, 0xE9F9B4A0L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  41. DEFINE_GUID(IID_I3DShExtension, 0xE9F9B4A1L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  42.  
  43. // Classes always available with Ray Dream Designer 3:
  44. DEFINE_GUID(CLSID_StandardGroup, 0xEBE99DC0L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  45. DEFINE_GUID(CLSID_StandardInstance, 0x2C00DD40L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  46. DEFINE_GUID(CLSID_StandardConicalCamera, 0x2E971880L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  47. DEFINE_GUID(CLSID_StandardIsometricCamera, 0x3063E940L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  48. DEFINE_GUID(CLSID_StandardSpotLight, 0x31F6BE40L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  49. DEFINE_GUID(CLSID_StandardBulbLight, 0x33806B80L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  50. DEFINE_GUID(CLSID_StandardDistantLight, 0x353C7360L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  51.  
  52.  
  53. // Preset codes for I3DShCamera::Preset():
  54. enum {kReferencePreset, kTopPreset, kBottomPreset, kLeftPreset, kRightPreset, kFrontPreset, kBackPreset};
  55.  
  56. //psq: should be redefined differently
  57. struct IShRasterOffscreen;
  58. struct I3DShTreeBehavior;
  59. struct I3DShDeformer;
  60. typedef void*    (*UVMapConvertProc)(IShRasterOffscreen *offscreen,long channel);
  61. typedef void    (*UVMapDeleteProc)(void *convertedUVMap, long channel);
  62.  
  63. /*****************************************************************************\
  64. *  I3DShTreeElement                                                           *
  65. *                                                                             *
  66. *    I3DShTreeElement is the abstract class of all elements in a tree.        *
  67. *                                                                             *
  68. *    You can always get this interface from a I3DShGroup, I3DShInstance, etc. *
  69. *                                                                             *
  70. \*****************************************************************************/
  71.  
  72. /*for SetGlobalTransform8 mode */
  73. #define kXTreeBehaviorDefault 0
  74. #define kXTreeBehaviorTrackT 1
  75. #define kXTreeBehaviorTrackR 2
  76.  
  77. /* Behavior Message Flags */
  78. #define kBMUpdatePhysics 1
  79.  
  80. #define kPathNameSeparator  '.'
  81.  
  82. #undef  INTERFACE
  83. #define INTERFACE   I3DShTreeElement
  84.  
  85. DECLARE_INTERFACE_(I3DShTreeElement, IUnknown) {
  86.     // IUnknown methods
  87.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  88.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  89.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  90.  
  91.     // I3DShTreeElement methods
  92.     STDMETHOD(SetScene) (THIS_ I3DShScene* scene) PURE;    // This must be called after creating a Tree Element
  93.     STDMETHOD_(I3DShScene*, GetScene) (THIS) PURE;
  94.     //-- Naming
  95.     STDMETHOD(SetName) (THIS_ char* name) PURE;
  96.     STDMETHOD(GetName) (THIS_ char* name) PURE;
  97.     //-- Tree navigation
  98.     STDMETHOD_(I3DShTreeElement*, GetFirst) (THIS) PURE;    // Gives first son
  99.     STDMETHOD_(I3DShTreeElement*, GetLast) (THIS) PURE;        // Gives last son
  100.     STDMETHOD_(I3DShTreeElement*, GetLeft) (THIS) PURE;        // Gives left brother
  101.     STDMETHOD_(I3DShTreeElement*, GetRight) (THIS) PURE;    // Gives right brother
  102.     STDMETHOD_(I3DShTreeElement*, GetTop) (THIS) PURE;        // Gives father
  103.     //-- Tree manipulation
  104.     STDMETHOD_(I3DShTreeElement*, Unlink) (THIS) PURE;        // Unhook tree element from father, and returns old father
  105.     STDMETHOD(InsertFirst) (THIS_ I3DShTreeElement* newSon) PURE;            // Insert as the first son
  106.     STDMETHOD(InsertLast) (THIS_ I3DShTreeElement* newSon) PURE;            // Insert as the last son
  107.     STDMETHOD(InsertLeft) (THIS_ I3DShTreeElement* newBrother) PURE;    // Insert as the first left brother
  108.     STDMETHOD(InsertRight) (THIS_ I3DShTreeElement* newBrother) PURE;    // Insert as the first right brother
  109.     //-- Tree transformations
  110.     STDMETHOD(GetTransform) (THIS_ TREETRANSFORM3D* treeTransform) PURE;                // Local transform
  111.     STDMETHOD(SetTransform) (THIS_ TREETRANSFORM3D* treeTransform) PURE;                // Local transform
  112.     STDMETHOD(GetGlobalTransform) (THIS_ TREETRANSFORM3D* treeTransform) PURE;    // Global transform
  113.     STDMETHOD(SetGlobalTransform) (THIS_ TREETRANSFORM3D* treeTransform) PURE;    // Global transform
  114.     //-- Hot point
  115.     STDMETHOD(GetHotPoint) (THIS_ VECTOR3D* hotPoint) PURE;            // In local coordinates
  116.     STDMETHOD(SetHotPoint) (THIS_ VECTOR3D* hotPoint) PURE;            // In local coordinates
  117.     STDMETHOD(CenterElementOnHotPoint) (THIS) PURE;                            // This moves the tree element
  118.     STDMETHOD(CenterHotPointOnElement) (THIS) PURE;                            // This moves the hot point
  119.     STDMETHOD(TranslateHotPoint) (THIS_ VECTOR3D* delta) PURE;    // Translates hotpoint of delta (In local coordinates)
  120.     //-- Misc.
  121.     STDMETHOD_(I3DShTreeElement*, Clone) (THIS_ BOOLEAN cloneAll) PURE;
  122.     STDMETHOD(GetBBox) (THIS_ BOX3D* bbox, BOOLEAN excludeLightsAndCameras) PURE;
  123.     STDMETHOD(BeginMove) (THIS) PURE;
  124.     STDMETHOD(EndMove) (THIS) PURE;
  125.     //-- XYZ Scaling
  126.     STDMETHOD(GetXYZScaling) (THIS_ VECTOR3D* xyzScaling) PURE;
  127.     STDMETHOD(SetXYZScaling) (THIS_ VECTOR3D* xyzScaling) PURE;
  128.     //-- IK
  129.     STDMETHOD_(short,GetNbrFreedom)(THIS) PURE;
  130.     STDMETHOD(GetFreedomRange)(THIS_ short index,NUM3D *min,NUM3D *max) PURE;
  131.     STDMETHOD(GetFreedomTransform)(THIS_ MATRIX3D *RR,VECTOR3D *TT) PURE;
  132.     STDMETHOD(GetFreedomDerivative)(THIS_ short index,MATRIX3D *RR,VECTOR3D *TT) PURE;
  133.     STDMETHOD(IncrementFreedomValue)(THIS_ short index,NUM3D *value) PURE;
  134.     //--
  135.     STDMETHOD(GetFullName) (THIS_ char* fullName) PURE;   // Returns the "path name" of the tree element (nodes separated by kPathNameSeparator)
  136.     //-- Tree transformations API8 (more useful)
  137.     STDMETHOD(GetTransform8) (THIS_ TREETRANSFORM3D* treeTransform) PURE;
  138.     STDMETHOD(SetTransform8) (THIS_ TREETRANSFORM3D* treeTransform) PURE;
  139.     STDMETHOD(GetGlobalTransform8) (THIS_ TREETRANSFORM3D* treeTransform) PURE;
  140.     STDMETHOD(SetGlobalTransform8) (THIS_ TREETRANSFORM3D* treeTransform, short mode=kXTreeBehaviorDefault) PURE;
  141.     //-- TreeBehavior API10
  142.     STDMETHOD_(ULONG, GetTreeBehaviorsCount) (THIS) PURE;
  143.     STDMETHOD_(I3DShTreeBehavior*, GetTreeBehaviorByIndex) (THIS_ ULONG index) PURE;    // index is 1 based
  144.     STDMETHOD_(ULONG, GetDeformerCount) (THIS) PURE;
  145.     STDMETHOD_(I3DShDeformer*, GetDeformerByIndex) (THIS_ ULONG index) PURE;    // index is 1 based
  146.     STDMETHOD_(ULONG, GetDataComponentsCount) (THIS) PURE;
  147.     STDMETHOD_(I3DExGenericData*, GetDataComponentByIndex) (THIS_ ULONG index) PURE;    // index is 1 based
  148.     STDMETHOD(BehaviorsChanged) (THIS) PURE;
  149.     STDMETHOD(DeformersChanged) (THIS) PURE;
  150.     STDMETHOD(LinksChanged) (THIS) PURE;
  151.     STDMETHOD(GenericDataChanged) (THIS) PURE;
  152.     //-- BehaviorMessageFlags
  153.     STDMETHOD_(long, GetBehaviorMessageFlags) (THIS) PURE;
  154.     };
  155.  
  156.  
  157. /*****************************************************************************\
  158. *  I3DShGroup                                                                 *
  159. *                                                                             *
  160. *    I3DShGroup is a tree element that can be collapsed ("closed") or not.    *
  161. *    It can return a I3DShTreeElement interface on demand.                    *
  162. *                                                                             *
  163. \*****************************************************************************/
  164. struct InstanceAndTransform {
  165.     I3DShInstance *fInstance;
  166.     AFFINETRANSFORM fT;
  167.     };
  168. #undef  INTERFACE
  169. #define INTERFACE   I3DShGroup
  170.  
  171. DECLARE_INTERFACE_(I3DShGroup, IUnknown) {
  172.     // IUnknown methods
  173.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  174.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  175.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  176.     
  177.     // I3DShGroup methods
  178.     STDMETHOD(SetBBox) (THIS_ BOX3D* bbox) PURE;
  179.     STDMETHOD(DoOpenClose) (THIS_ BOOLEAN openIt) PURE;        // Use this call to open or close a group
  180.     STDMETHOD(OpenClose) (THIS_ BOOLEAN openIt) PURE;            // This lower level call just changes the status
  181.     STDMETHOD_(BOOLEAN, IsOpen) (THIS) PURE;
  182.  
  183.     //4.5
  184.     STDMETHOD(BeginGetInstances) (THIS_ long &nbrInstances,const InstanceAndTransform *&instances) PURE;            
  185.     STDMETHOD(EndGetInstances) (THIS) PURE;
  186.     STDMETHOD(RayHit) (THIS_ BOOLEAN &didHit,const Ray3D &aR,const RayHitParameters ¶ms,RayHit3D &hit) PURE;
  187.     };
  188.  
  189. /*****************************************************************************\
  190. *  I3DShLightsource                                                           *
  191. *                                                                             *
  192. *    I3DShLightsource defines the light sources as tree elements              *
  193. *    It can return a I3DShTreeElement interface on demand.                    *
  194. *                                                                             *
  195. \*****************************************************************************/
  196.  
  197. struct TLightTraceElement;
  198.  
  199. #undef  INTERFACE
  200. #define INTERFACE   I3DShLightsource
  201.  
  202. DECLARE_INTERFACE_(I3DShLightsource, IUnknown) {
  203.     // IUnknown methods
  204.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  205.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  206.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  207.  
  208.     // I3DShLightsource methods
  209.     STDMETHOD(GetLightGlobalTransform) (THIS_ TRANSFORM3D* transform) PURE;        // A little bit like GetGlobalTransform(), but without the scaling factor
  210.     STDMETHOD_(BOOLEAN, GetDirection) (THIS_ VECTOR3D* position, VECTOR3D* resultDirection, NUM3D* resultDistance) PURE;
  211.     STDMETHOD_(BOOLEAN, GetColor) (THIS_ VECTOR3D* position, VECTOR3D* direction, NUM3D distance, COLOR3D* result, BOOLEAN* callForShadowEffect) PURE;
  212.     STDMETHOD(ShadowEffect) (THIS_ NUM3D distanceThru, NUM3D distanceTotal, COLOR3D* result) PURE;
  213.     STDMETHOD(ForEachShadowBuffer) (THIS_ ForEachShadowBufferCallback proc, void* priv) PURE;
  214.     STDMETHOD(GetLightParameter) (THIS_ long keyword, void* parameter) PURE;
  215.  
  216.     //4.5
  217.     STDMETHOD(GetPrimitiveID) (THIS_ long &primID) PURE;
  218.     STDMETHOD(GetNewTrace) (THIS_ short &nb,TLightTraceElement *&traceElem) PURE;
  219.  
  220.     STDMETHOD_(I3DExShadowFeature*, GetShadowFeature) () PURE;
  221.     };
  222.  
  223. /*****************************************************************************\
  224. *  I3DShCamera                                                                *
  225. *                                                                             *
  226. *    I3DShCamera defines the cameras as tree elements                         *
  227. *    It can return a I3DShTreeElement interface on demand.                    *
  228. *                                                                             *
  229. \*****************************************************************************/
  230.  
  231. #undef  INTERFACE
  232. #define INTERFACE   I3DShCamera
  233.  
  234. DECLARE_INTERFACE_(I3DShCamera, IUnknown) {
  235.     // IUnknown methods
  236.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  237.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  238.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  239.  
  240.     // I3DShCamera methods
  241.     STDMETHOD(GetGlobalToCameraTransform) (THIS_ TRANSFORM3D* transform) PURE;                    // Gives the transformation from the Global Coordinate System to the Screen Coordinate System
  242.     STDMETHOD(Preset) (THIS_ ULONG preset, VECTOR3D* aimedPoint, NUM3D distance) PURE;    // See preset codes above
  243.     STDMETHOD_(BOOLEAN, Project3DTo2D) (THIS_ VECTOR3D* position, VECTOR2D* resultScreenPosition, NUM3D* resultDistanceToScreen) PURE;
  244.     STDMETHOD_(BOOLEAN, CreateRay) (THIS_ VECTOR2D* screenPosition, VECTOR3D* resultOrigin, VECTOR3D* resultDirection) PURE;
  245.     STDMETHOD_(ULONG, Clip3D) (THIS_  FACET3D* localFacet, VERTEX3D* localVertices,
  246.                                                                         FACET3D* cameraFacet, VERTEX3D* cameraVertices,
  247.                                                                         NUM3D* clipBox) PURE;
  248.     STDMETHOD(GetRenderUVBox) (THIS_ BOX2D *uvBox) PURE;
  249.   };
  250.  
  251. /*****************************************************************************\
  252. *  I3DShInstance                                                              *
  253. *                                                                             *
  254. *    I3DShInstance defines the object instances in the tree                   *
  255. *    It can return a I3DShTreeElement interface on demand.                    *
  256. *                                                                             *
  257. \*****************************************************************************/
  258.  
  259.  
  260.  
  261. enum {kUVMapColor=1, kUVMapHighlight=2, kUVMapShininess=4,
  262.                 kUVMapBump=8, kUVMapReflection=16, kUVMapTransparency=32,
  263.                 kUVMapRefraction=64, kUVMapGlow=128};
  264.  
  265. enum {kUVMapColorIndex,kUVMapHighlightIndex,kUVMapShininessIndex,kUVMapBumpIndex,
  266.                         kUVMapReflectionIndex,kUVMapTransparencyIndex,kUVMapRefractionIndex,
  267.                         kUVMapGlowIndex};
  268. enum {kNbrUVMapsIndices=8};
  269. #define UVMapIndexToMask(index) (1<<index)
  270.  
  271. struct UVMaps {
  272.     IShRasterOffscreen *fMap[kNbrUVMapsIndices];
  273.     };
  274.  
  275. struct MapParams {
  276.     Boolean  fFlipVert;          // true if and only if the map ]r should be flipped FROM ITS ORIGINAL orientation
  277.     Boolean  fFlipHoriz;
  278.     NUM3D    fBrightness;        // A quickfix number between zero and one (65536) 
  279.     short    fNinetyDegreeCount; //    number between 0 and 3 indicating the number of rotations to do on the map
  280.     };
  281.  
  282.  
  283. DECLARE_INTERFACE_(I3DFacetCache, IUnknown) {
  284.     };
  285.  
  286. DECLARE_INTERFACE_(I3DShIRCache, IUnknown) {
  287.     };
  288.  
  289. struct TZBInfo;
  290. struct IShLineArt;
  291. struct I3DShCamera;
  292.  
  293. DECLARE_INTERFACE_(IFacetMesh, IUnknown) {
  294.     STDMETHOD(GetFacetMesh) (FacetMesh &facetMesh) PURE;
  295.     STDMETHOD(GetLevelOfDetail) (NUM3D &lod) PURE;
  296.     };
  297.     
  298. #undef  INTERFACE
  299. #define INTERFACE   I3DShInstance
  300. DECLARE_INTERFACE_(I3DShInstance, IUnknown) {
  301.     // IUnknown methods
  302.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  303.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  304.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  305.  
  306.     // I3DShInstance methods
  307.     //-- Object referencing
  308.     STDMETHOD_(I3DShObject*, Get3DObject) (THIS) PURE;
  309.     STDMETHOD(Set3DObject) (THIS_ I3DShObject* object) PURE;
  310.     //-- Shading at the Instance level
  311.     STDMETHOD_(ULONG, GetUVSpaceCount) (THIS) PURE;
  312.     STDMETHOD(GetUVSpace) (THIS_ ULONG uvSpaceID, UVSpaceInfo* uvSpaceInfo) PURE;
  313.     STDMETHOD(AddShadingShape) (THIS_ ShadingShape* shadingShape, ULONG uvSpaceID) PURE;
  314.     STDMETHOD(GetShadingFlags) (THIS_ ShadingFlags* theFlags) PURE;
  315.     STDMETHOD(DoShade) (THIS_ ShadingInOut* shadingInOut) PURE;
  316.     STDMETHOD(GetMainColors) (THIS_ COLOR3D* color1, COLOR3D* color2) PURE;
  317.     STDMETHOD_(long, GetShadingLevel) (THIS) PURE;
  318.     STDMETHOD(GetUVRasterShMap) (THIS_ long uvSpaceIndex,short& sizeU, short& sizeV, UVMaps* maps, long channels, void *viewPriv) PURE;
  319.     STDMETHOD(GetUVExportShMap) (THIS_ long uvSpaceIndex,short& sizeU, short& sizeV, FixPtRect *range, UVMaps* maps, long channels) PURE;
  320.     STDMETHOD_(BOOLEAN, FreeUVShMap) (THIS_ long uvSpaceIndex) PURE;
  321.     //-- For renderers
  322.     STDMETHOD(GetFlatness) (THIS_  NUM3D *flatness) PURE;
  323.     STDMETHOD(Draw) (THIS_  TZBInfo *aZBInfo, short *drawn) PURE;
  324.     STDMETHOD(DrawLA) (THIS_  IShLineArt *aLineArt,TREETRANSFORM3D *aTS,I3DShCamera *acamera,RECT3D *area,short modeD) PURE;
  325.     STDMETHOD(GetBoxes) (THIS_  TZBInfo *aZBInfo,NUM3D *minZ,NUM3D *maxZ,BOX2D *clip,BOX3D *box) PURE;
  326.     STDMETHOD(GetBB) (THIS_  BOX3D *bbox) PURE;
  327.     STDMETHOD(Dehydrate) (THIS_  short level) PURE;
  328.     STDMETHOD_(BOOLEAN,RayHit) (THIS_  Ray3D *aR,RayHitParameters *params,RayHit3D *hit) PURE;
  329.     STDMETHOD(GetAllInfo) (THIS_  RayHit3D *hit,short *uvSpaceID) PURE;
  330.     //-- New misc. calls (API level 6)
  331.     STDMETHOD_(I3DShObject*, GetDeformed3DObject) (THIS) PURE;    // Same as Get3DObject(), but with the deformations applied on the object
  332.     STDMETHOD(EnumFacetsWithConversion) (THIS_ EnumFacetsCallback callback, void* privData, BOOLEAN doPatches, NUM3D error) PURE;    // Use this call when you want facets even for patch based objects, and be able to control the error in the facettisation process
  333.  
  334.     STDMETHOD(SetShadingFromMaps) (THIS_ long uvSpaceIndex, UVMaps* maps, MapParams* mapParams, const FixPtRect& shapeRect) PURE;
  335.  
  336.     STDMETHOD_(short, GetMappingKind) (THIS) PURE;
  337.     STDMETHOD(SetMappingKind) (THIS_ short mappingKind) PURE;
  338.     STDMETHOD(GetMappingDirection) (THIS_ MATRIX3D* transform) PURE;
  339.     STDMETHOD(SetMappingDirection) (THIS_ MATRIX3D* transform) PURE;
  340.     STDMETHOD(GetURL) (THIS_ char* name, short *kind) PURE;
  341.     STDMETHOD_(long, GetClassSignature) (THIS) PURE;
  342.     STDMETHOD_(long, GetInstanceKind) (THIS) PURE;
  343.     
  344.     STDMETHOD(GetShadingBBox) (THIS_ BOX3D* shadingBBox) PURE;
  345.     //API8
  346.     STDMETHOD_(BOOLEAN, IsVolumeInstance) (THIS) PURE;
  347.     //4.5
  348.     STDMETHOD(GetFMesh) (NUM3D lod,IFacetMesh *&amesh) PURE;
  349.     STDMETHOD(SetFCache) (void *priv,const AFFINETRANSFORM &aT,I3DFacetCache *theFCache) PURE;
  350.     STDMETHOD(GetFCache) (void *priv,const AFFINETRANSFORM &aT,I3DFacetCache *&theFCache) PURE;
  351.     STDMETHOD(ClearFCache) (void *priv) PURE;
  352.     STDMETHOD(GetIndex) (long &index) PURE;
  353.     STDMETHOD(GetVertexUV) (BOOLEAN &res,const VECTOR3D &theVertex,VECTOR2D &theUV) PURE;
  354.     STDMETHOD_(BOOLEAN, IsShadowCastingOn) (THIS) PURE;
  355.  
  356.     STDMETHOD_(I3DExReflectionFeature*, GetReflectionFeature) () PURE;
  357.     STDMETHOD_(I3DExRefractionFeature*, GetRefractionFeature) () PURE;
  358.  
  359.     STDMETHOD_(BOOLEAN, ChangeUVForProjectionMapping) (long nbrVertices,VERTEX3D *vertices) const PURE;
  360.     //5.0
  361.     STDMETHOD(ExportFMesh) (NUM3D quality,FacetMesh &facetMesh) const PURE; //quality==1 is default (average)
  362.     };
  363.  
  364. #undef  INTERFACE
  365. #define INTERFACE   I3DShExtension
  366.  
  367. DECLARE_INTERFACE_(I3DShExtension, IUnknown) {
  368.     // IUnknown methods
  369.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  370.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  371.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  372.  
  373.     // I3DShExtension methods
  374.     STDMETHOD_(char*, GetParamsBuffer) (THIS) PURE;
  375.     STDMETHOD_(short, GetResID) (THIS) PURE;
  376.     STDMETHOD_(short, GetViewID) (THIS) PURE;
  377.     STDMETHOD_(BOOLEAN, IsEqual) (THIS_ I3DShExtension* extension) PURE;
  378.     STDMETHOD(GetParameter) (THIS_ long param,void *) PURE;
  379.     STDMETHOD(SetParameter) (THIS_ long param,void *) PURE;
  380.     STDMETHOD_(long, GetClassSignature) (THIS) PURE;
  381.     STDMETHOD(GetComponentClassName) (THIS_ char* name) PURE;
  382.     };
  383.  
  384. #endif
  385.